package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.system.SysUserControllerApi;
import com.nineclock.message.dto.SysRegisterDTO;
import com.nineclock.system.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/user")
public class SysUserController implements SysUserControllerApi {
    @Autowired
    SysUserService sysUserService;


    @PostMapping("/register")
    @Override
    public Result<Long> register(SysRegisterDTO sysRegisterDTO) {
        Long userId = sysUserService.register(sysRegisterDTO);
        return Result.success(userId);
    }
}
